import React from 'react';
export default class App extends React.Component {
  state = {
    count: 0,
  };

  handleClick = () => {
    this.setState({ count: this.state.count + 1 });
  };

  render() {
    return (
      <div>
        <h1>数量： {this.state.count}</h1>
        <button onClick={this.handleClick}>点我修改数量</button>
        <Footer></Footer>
      </div>
    );
  }
}

class Footer extends React.Component {
  componentDidUpdate() {
    console.log('componentDidUpdate 更新完毕  ----->  ');
  }
  render() {
    console.log('我被更新过了  ----->  ');
    return <div>我是Footer, 我是写死的内容</div>;
  }
}
